'use strict'
// 导包
const express=require('express');
const app=express();
const path=require('path');
const bodyParser = require('body-parser')

// parse application/x-www-form-urlencoded 
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json 
app.use(bodyParser.json())


// 导入静态资源
app.use(express.static(path.join(__dirname,'src/statics')));
const accountRouter=require(path.join(__dirname,'src/routers/accountRouter.js'));
const studentManagerRouter=require(path.join(__dirname,'src/routers/studentManagerRouter.js'))
app.use('/account',accountRouter)
app.use('/studentManager',studentManagerRouter);

app.listen(5000,'127.0.0.1',(err)=>{
  if(err){
    console.log(err);
  }
  console.log('开启成功');
})
